package com.sg.dto.biz.framework.common;

import com.sg.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;


/**
 * @desc SubordinateDeptDto
 * @使用场景
 */
@Data
public class SubordinateDeptDto extends BaseDto implements Serializable {

    /**
     * 部门ID
     */
    @NotNull(message = "部门ID不能为空")
    @ApiModelProperty("部门ID")
    private String deptId;

    /**
     * 父级部门ID
     */
    @NotNull(message = "父级部门ID不能为空")
    @ApiModelProperty("父级部门ID")
    private String parentDeptId;

    /**
     * 是否可创建下级部门 TRUE:是 FALSE:否
     */
    @NotNull(message = "是否可创建下级部门不能为空")
    @ApiModelProperty("是否可创建下级部门")
    private String isCreateLowerDept;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        SubordinateDeptDto that = (SubordinateDeptDto) o;
        return deptId == that.deptId && parentDeptId == that.parentDeptId && isCreateLowerDept == that.isCreateLowerDept;
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), deptId, parentDeptId, isCreateLowerDept);
    }


}
   